/***
WaveReflection
创建人：ZЁЯ¤　身高：168cm+；体重：57kg+；未婚（已有女友）；最爱的运动：睡觉；格言：路见不平，拔腿就跑。QQ：358315553。
创建时间：2012年12月06日 17:38:46
简要说明：这家伙很懒什么都没写。
用法举例：这家伙还是很懒什么都没写。
*/

package zero.shaders.test{
	import flash.display.*;
	import flash.geom.*;
	import flash.utils.*;
	import zero.shaders.*;
	
	/**
	 * 
	 * 水波倒影反射
	 * 
	 */	
	public class WaveReflection extends BaseShader{
		
		public static const nameV:Vector.<String>=new <String>["alpha","progress","amplitude","frequency"];
		//WaveReflectionCode//为了编译进来
		public static const byteV:Vector.<int>=new <int>[0xa5,0x01,0x00,0x00,0x00,0xa4,0x0e,0x00,0x57,0x61,0x76,0x65,0x52,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0xa0,0x0c,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x00,0x7a,0x65,0x72,0x6f,0x2e,0x73,0x68,0x61,0x64,0x65,0x72,0x73,0x2e,0x74,0x65,0x73,0x74,0x00,0xa0,0x0c,0x76,0x65,0x6e,0x64,0x6f,0x72,0x00,0x5a,0xa7,0xa7,0xa7,0xc1,0xa1,0xe8,0x00,0xa0,0x08,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x00,0x02,0x00,0xa0,0x0c,0x64,0x65,0x73,0x63,0x72,0x69,0x70,0x74,0x69,0x6f,0x6e,0x00,0xcb,0xae,0xb2,0xa8,0xb5,0xb9,0xd3,0xb0,0xb7,0xb4,0xc9,0xe4,0x00,0xa1,0x01,0x02,0x00,0x00,0x0c,0x5f,0x4f,0x75,0x74,0x43,0x6f,0x6f,0x72,0x64,0x00,0xa1,0x01,0x01,0x00,0x00,0x02,0x61,0x6c,0x70,0x68,0x61,0x00,0xa1,0x01,0x01,0x00,0x00,0x01,0x70,0x72,0x6f,0x67,0x72,0x65,0x73,0x73,0x00,0xa1,0x01,0x01,0x01,0x00,0x08,0x61,0x6d,0x70,0x6c,0x69,0x74,0x75,0x64,0x65,0x00,0xa1,0x01,0x01,0x01,0x00,0x04,0x66,0x72,0x65,0x71,0x75,0x65,0x6e,0x63,0x79,0x00,0xa3,0x00,0x04,0x73,0x72,0x63,0x00,0xa1,0x02,0x04,0x02,0x00,0x0f,0x64,0x73,0x74,0x00,0x32,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x2a,0x01,0x00,0x20,0x00,0x00,0x80,0x00,0x1d,0x01,0x80,0x80,0x00,0x80,0x00,0x00,0x34,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x1d,0x01,0x00,0x31,0x00,0x00,0x10,0x00,0x32,0x03,0x00,0x80,0x3f,0x80,0x00,0x00,0x1d,0x03,0x00,0x40,0x03,0x00,0x00,0x00,0x02,0x03,0x00,0x40,0x00,0x00,0xc0,0x00,0x1d,0x03,0x00,0x80,0x01,0x00,0xc0,0x00,0x02,0x03,0x00,0x80,0x03,0x00,0x40,0x00,0x32,0x03,0x00,0x40,0x42,0xc9,0x14,0x7b,0x1d,0x03,0x00,0x20,0x03,0x00,0x40,0x00,0x02,0x03,0x00,0x20,0x01,0x00,0x40,0x00,0x1d,0x03,0x00,0x40,0x03,0x00,0x00,0x00,0x03,0x03,0x00,0x40,0x03,0x00,0x80,0x00,0x0c,0x03,0x00,0x80,0x03,0x00,0x40,0x00,0x32,0x03,0x00,0x40,0x3d,0xcc,0xcc,0xcd,0x1d,0x03,0x00,0x20,0x01,0x00,0x00,0x00,0x03,0x03,0x00,0x20,0x03,0x00,0x40,0x00,0x1d,0x03,0x00,0x40,0x03,0x00,0x00,0x00,0x03,0x03,0x00,0x40,0x03,0x00,0x80,0x00,0x32,0x03,0x00,0x80,0x3f,0x80,0x00,0x00,0x1d,0x03,0x00,0x20,0x03,0x00,0x00,0x00,0x02,0x03,0x00,0x20,0x01,0x00,0xc0,0x00,0x1d,0x03,0x00,0x80,0x03,0x00,0x40,0x00,0x03,0x03,0x00,0x80,0x03,0x00,0x80,0x00,0x01,0x01,0x00,0x10,0x03,0x00,0x00,0x00,0x30,0x03,0x00,0xf1,0x01,0x00,0xb0,0x00,0x1d,0x02,0x00,0xf3,0x03,0x00,0x1b,0x00,0x03,0x02,0x00,0x10,0x00,0x00,0x80,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x02,0x00,0x80,0x00,0x00,0x00,0x00,0x32,0x02,0x00,0x40,0x00,0x00,0x00,0x00,0x32,0x02,0x00,0x20,0x00,0x00,0x00,0x00,0x32,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00];
		
		/**
		 * 
		 * 透明度 （0~1） 默认 1
		 * 
		 */
		public var alpha:Number;
		
		/**
		 * 
		 * animate this value to create the ripple effect （0~1） 默认 0
		 * 
		 */
		public var progress:Number;
		
		/**
		 * 
		 * controls the height of the waves （0~1） 默认 0.33
		 * 
		 */
		public var amplitude:Number;
		
		/**
		 * 
		 * controls the frequency of the waves （0~0.54） 默认 0.22
		 * 
		 */
		public var frequency:Number;
		

		/**
		 * 
		 * 透明度 （0~1） 默认 1<br/>
		 * animate this value to create the ripple effect （0~1） 默认 0<br/>
		 * controls the height of the waves （0~1） 默认 0.33<br/>
		 * controls the frequency of the waves （0~0.54） 默认 0.22<br/>
		 * 
		 */
		public function WaveReflection(_alpha:Number=1,_progress:Number=0,_amplitude:Number=0.33,_frequency:Number=0.22){
			alpha=_alpha;
			(data.alpha as ShaderParameter).value=[];
			progress=_progress;
			(data.progress as ShaderParameter).value=[];
			amplitude=_amplitude;
			(data.amplitude as ShaderParameter).value=[];
			frequency=_frequency;
			(data.frequency as ShaderParameter).value=[];
		}
		
		override public function updateParams():void{
			(data.alpha as ShaderParameter).value[0]=alpha;
			(data.progress as ShaderParameter).value[0]=progress;
			(data.amplitude as ShaderParameter).value[0]=amplitude;
			(data.frequency as ShaderParameter).value[0]=frequency;
		}
		

	}
}